<html>
<head><meta charset="utf-8"><title>casting trait object pointers to concrete pointers · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/casting.20trait.20object.20pointers.20to.20concrete.20pointers.html">casting trait object pointers to concrete pointers</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="163870721"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/casting%20trait%20object%20pointers%20to%20concrete%20pointers/near/163870721" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/casting.20trait.20object.20pointers.20to.20concrete.20pointers.html#163870721">(Apr 21 2019 at 22:38)</a>:</h4>
<p>Is it documented somewhere "official" that <code>*const Trait as *const Concrete</code> will only grab the data pointer and not the vtable?</p>



<a name="164113027"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/casting%20trait%20object%20pointers%20to%20concrete%20pointers/near/164113027" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/casting.20trait.20object.20pointers.20to.20concrete.20pointers.html#164113027">(Apr 24 2019 at 19:39)</a>:</h4>
<p>I believe that was decided in an RFC</p>



<a name="164113046"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/casting%20trait%20object%20pointers%20to%20concrete%20pointers/near/164113046" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/casting.20trait.20object.20pointers.20to.20concrete.20pointers.html#164113046">(Apr 24 2019 at 19:39)</a>:</h4>
<p>One written by nrc, if memory serves</p>



<a name="164113158"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/casting%20trait%20object%20pointers%20to%20concrete%20pointers/near/164113158" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/casting.20trait.20object.20pointers.20to.20concrete.20pointers.html#164113158">(Apr 24 2019 at 19:41)</a>:</h4>
<p>maybe <a href="https://rust-lang.github.io/rfcs/0401-coercions.html" target="_blank" title="https://rust-lang.github.io/rfcs/0401-coercions.html">RFC 401</a>?</p>



<a name="164113163"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/casting%20trait%20object%20pointers%20to%20concrete%20pointers/near/164113163" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/casting.20trait.20object.20pointers.20to.20concrete.20pointers.html#164113163">(Apr 24 2019 at 19:41)</a>:</h4>
<p>I think it was a mistake but never mind</p>



<a name="164113168"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/casting%20trait%20object%20pointers%20to%20concrete%20pointers/near/164113168" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/casting.20trait.20object.20pointers.20to.20concrete.20pointers.html#164113168">(Apr 24 2019 at 19:41)</a>:</h4>
<p>(well, at least, i've had subtle bugs as a result)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>